home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ian & Stuart's Australian Mac 1993 September
/
clonecd
/
September 93.img
/
Archives
/
Fun, Tricks & Hacks
/
Hacks & Tricks - CARE
/
HotShift
/
HotShift.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-01
|
877b
|
39 lines
pascal void main(void);
pascal void main(void)
{
Ptr addr;
Ptr globalP;
long rD0;
EventRecord *rA1;
asm {
MOVEM.L A2-A5/D1-D7, -(A7) /* Save the non-volitle registers */
MOVE.L d0, rD0 /* Get to d0 & a0 easily */
MOVE.L a1, rA1
}
addr = *(Ptr *)(((Ptr)&main) - 8); /* Get the address of last filter */
globalP = *(Ptr *)(((Ptr)&main) - 4); /* Get the address of global storage */
/* The structure is:
long last filter address;
Ptr globalDataSpace; */
// if ((rA1->what == mouseDown) || (rA1->what == mouseUp) || (rA1->what == nullEvent))
// {
// DebugStr("\PAdjusting cursor");
rA1->where.h -= 32;
rA1->where.v -= 32;
// }
asm {
MOVEM.L (A7)+, A2-A5/D1-D7 /* Restore the non-volitle registers */
MOVE.L rD0, d0
MOVE.L rA1, a1
MOVE.L addr, A0
UNLK A6
JMP (A0)
};
}